import { Suspense, useEffect } from 'react';
import { useRoutes } from 'react-router-dom';
import routes from './router';
// import { useSelector } from 'react-redux';
// import routes from './router';
// import { DataAPI } from '@/api/index';
export default function App() {
  // const [msg, setMsg] = useState('');
  // const count = useSelector((state: any) => state.counter.count);
  const getData = async () => {
    // const res = await DataAPI();
    // setMsg(res.data);
  };
  useEffect(() => {
    getData();
  });
  return (
    <div className="App">
      <Suspense fallback="正在加载">{useRoutes(routes)}</Suspense>
      {/* <div>store测试:{count}</div>
      <div>api测试:{msg}</div> */}
    </div>
  );
}
